class Solution {
public:
    bool isAnagram(string s, string t) {
        size_t len = s.size();
        if (s.size() != t.size())
            return false;
        int arr[26] = { 0 };
        for (int i = 0; i < len; i++)
        {
            arr[s[i] - 'a'] += 1;
            arr[t[i] - 'a'] -= 1;
        }
        int count = 0;
        for (int i = 0; i < 26; i++)
        {
            if (arr[i] == 0)
                count++;
        }
        return count == 26;
    }
};
